// pages/newsList/newsList.js
const app = getApp();

Page({
  data: {
    newsList: []
  },

  onLoad() {
    this.setData({
      newsList: app.globalData.news
    });
  },

  goToNews(e) {
    const id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: `/pages/detail/detail?type=news&id=${id}`
    });
  }
});